home *** CD-ROM | disk | FTP | other *** search
- .TH Animation
- 6 "IRIT Version 6.0"
- .SH NAME
- Animation
-
-
-
- The animation tool adds the capability of animating objects using
- forward kinematics, exploiting animation curves. Each object has
- different attributes, that prescribe its motion, scale, and visibility
- as a function of time. Every attribute has a name, which designates
- it's role. For instance an attribute animation curve named MOV_X
- describes a translation motion along the X axis.
-
- .SH How to create animation curves in IRIT
-
-
-
- Let OBJ be an object in IRIT to animate.
-
- Animation curves are either scalar (E1/P1) curves or three dimensional
- (E3/P3) curves with one of the following names:
-
- MOV_X, MOV_Y, MOV_Z Translation along one axis
- MOV_XYZ Arbitrary translation along all three axes
- ROT_X, ROT_Y, ROT_Z Rotating around a single axis (degrees)
- SCL_X, SCL_Y, SCL_Z Scale along a single axis
- SCL Global scale
- VISIBLE Visibility
-
-
- The visibility curve is a scalar curve that enables the display of
- the object if the visibility curve is positive at time t and disables
- the display (hide) the object if the visibility curve is negative at
- time t.
-
- The animation curves are all attached as an attribute named "animation"
- to the object OBJ.
-
- Example:
- mov_x = cbezier( ctlpt( E1, 0.0 ),
- ctlpt( E1, 1.0 ) );
- scl = cbezier( ctlpt( E1, 1.0 ),
- ctlpt( E1, 0.1 ) );
- rot_y = cbezier( ctlpt( E1, 0.0 ),
- ctlpt( E1, 0.0 ) );
- ctlpt( E1, 360.0 ) );
- attrib(OBJ, "animation", list( mov_x, scl, rot_y ) );
-
- To animate OBJ between time zero and one (Bezier curves are always
- between zero and one), by moving it a unit size in the X direction,
- scaling it to %10 of its original size and rotating it at increasing
- angular speed from zero to 360 degrees.
-
- OBJ can now be save into a file or displayed via one of the regular
- viewing commands in IRIT (i.e. VIEWOBJ).
-
- Animation is not always between zero and one. To that end one can
- apply the CREPARAM function to modify the parametric domain of the
- animation curve. The convention is that if the time is below the
- starting value of the parametric domain, the starting value of the
- curve is used. Similarly if the time is beyond the end of the
- parameter domain of the animation curve, the end value of the
- animation curve is used.
-
- Example:
- CREPARAM( mov_x, 3.0, 5.0 );
-
- to set the time of the motion in the x axis to be from t = 3 to
- t = 5. for t < 3, mov_x(3) is used, and for t > 5, mov_x(5) is
- employed.
-
- the animation curves are regular objects in the IRIT system. Hence,
- only one object named mov_x or scl can exist at one time. If you
- create a new object named mov_x, the old one is overwritten! To
- preserve old animation curves you can detach the old ones by executing
- 'free(mov_x)' that removes the object named mov_x from IRIT's object
- list but not from its previous used locations within other list
- objects, if any. For example:
-
- mov_x = cbezier( ctlpt( E1, 0.0 ),
- ctlpt( E1, 1.0 ) );
- attrib(obj1, "animation", list( mov_x ) );
- free(mov_x);
-
- mov_x = cbezier( ctlpt( E1, 2.0 ),
- ctlpt( E1, 3.0 ) );
- attrib(obj2, "animation", list( mov_x ) );
- free(mov_x);
-
- .SH A more complete animation example
-
-
-
- a = box( vector( 0, 0, 0 ), 1, 1, 1 );
- b = box( vector( 0, 0, 0 ), 1, 1, 1 );
- c = box( vector( 0, 0, 0 ), 1, 1, 1 );
- d = sphere( vector( 0, 0, 0), 0.7 );
-
- pt0 = ctlpt( e1, 0.0 );
- pt1 = ctlpt( e1, 1.0 );
- pt2 = ctlpt( e1, 2.0 );
- pt6 = ctlpt( e1, 6.0 );
- pt360 = ctlpt( e1, 360.0 );
-
- pt10 = ctlpt( e1, -4.0 );
- pt11 = ctlpt( e1, 1.0 );
- pt12 = ctlpt( e1, 4.0 );
- pt13 = ctlpt( e1, -1.0 );
-
- visible = creparam( cbezier( list( pt10, pt11 ) ), 0.0, 5.0 );
- mov_x = creparam( cbezier( list( pt0, pt6, pt2 ) ), 0.0, 1.2 );
- mov_y = mov_x;
- mov_z = mov_x;
- rot_x = creparam( cbspline( 2,
- list( pt0, pt360, pt0 ),
- list( KV_OPEN ) ),
- 1.2, 2.5 );
- rot_y = rot_x;
- rot_z = rot_x;
- scl = creparam( cbezier( list( pt1, pt2, pt1, pt2, pt1 ) ),
- 2.5, 4.0 );
- scl_x = scl;
- scl_y = scl;
- scl_z = scl;
- mov_xyz = creparam( circle( vector( 0, 0, 0 ), 2.0 ), 4.0, 5.0 );
-
- attrib( d, "animation", list( mov_xyz, visible ) );
- free( visible );
-
- visible = creparam( cbezier( list( pt12, pt13 ) ), 0.0, 5.0 );
-
- attrib( a, "animation", list( rot_x, mov_x, scl, scl_x, visible ) );
- attrib( b, "animation", list( rot_y, mov_y, scl, scl_y, visible ) );
- attrib( c, "animation", list( rot_z, mov_z, scl, scl_z, visible ) );
-
- color( a, red );
- color( b, green );
- color( c, blue );
- color( d, cyan );
-
- demo = list( a, b, c, d );
-
- interact( demo );
- viewanim( 0, 5, 0.01 );
-
- In this example, we create four objects, three cubes and one sphere.
- Animation curves to translate the three cubes along the three axes for
- the time period of t = 0 to t = 1.2 are created. Rotation curves to
- rotate the three cubes along the three axes are then created for time
- period of t = 1.2 to t = 2.5. Finally, for the time period of t = 2.5
- to t = 4.0. the cubes are (not only) unifomly scaled. For the time
- period of t = 4 to t = 5, the cubes become invisible and the sphere,
- that becomes visible, is rotated along a circle of radius 2.
-
-